﻿<%@ Page 
    Language="C#" 
    MasterPageFile="~/Views/Shared/Site.Master" 
    Inherits="System.Web.Mvc.ViewPage<IList<Aluno>>" 
%>
<%@ Import 
    Namespace="Arquitetura.UI.MVC.SecretariaServiceReference" 
%>
<asp:Content ID="indexHead" ContentPlaceHolderID="head" runat="server">
    <title>Home Page</title>
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <div class="Cadastro">
        <form id="frmPesquisa" method="post" action="/Alunos/Listar">
            <table>
                <tr>
                    <td>
                        <label for="nome">
                            Nome:
                        </label>
                    </td>
                    <td>
                        <input type="text" name="nome" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="sobrenome">
                            Sobrenome:
                        </label>
                    </td>
                    <td>
                        <input type="text" name="sobrenome" />
                    </td>
                </tr>
                <tr>
                    <td />
                    <td>
                        <input type="submit" value="Pesquisar" />
                        <input type="reset" value="Limpar" />              
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div>
        <table class="Grid">
            <tr class="Header">
                <th>
                    Prontuario
                </th>
                <th>
                    Nome
                </th>
                <th>
                    Sobrenome
                </th>
                <th>
                    CPF
                </th>
                <th>
                    RG
                </th>
            </tr>
            <%bool alternate = true; %>
            <%foreach (Aluno aluno in Model)
              {
                  alternate = !alternate;
                  %>
            <tr class='<%= (!alternate ? "Row" : "AlternatingRow") %>'>
                <td>
                    <%= Html.Encode(aluno.Prontuario) %>
                </td>
                <td>
                    <%= Html.Encode(aluno.Nome) %>
                </td>
                <td>
                    <%= Html.Encode(aluno.Sobrenome) %>
                </td>
                <td>
                    <%= Html.Encode(aluno.CPF) %>
                </td>
                <td>
                    <%= Html.Encode(aluno.RG) %>
                </td>
            </tr>        
            <%} %>
        </table>
    </div>
</asp:Content>
